<template>
    <div>
<h1>修改界面</h1>
<table>
    <tbody>
        <tr>
            <td>房型名称</td>
            <td>
                <input type="text" v-model="data.name">
            </td>
        </tr>

        <tr>
            <td>门市价格</td>
            <td>
                <input type="text" v-model="data.jiaGe">
            </td>
        </tr>

        <tr>
            <td>房间号</td>
            <td>
                <span v-for="a in fjh">
                    <input type="checkbox" :value="a">{{ a }}
                </span>
            </td>
        </tr>

        <tr>
            <td>状态</td>
            <td>
                   <input type="radio" v-model="data.zhuangTai" :value=true>启用
                    <input type="radio" v-model="data.zhuangTai" :value=false>停用
            </td>
        </tr>

        <tr>
            <td></td>
            <td>
               <input type="button" value="确认修改">
            </td>
        </tr>
    </tbody>
</table>
    </div>
</template>

<script setup lang="ts">
import axios from 'axios';
import { onMounted, ref } from 'vue';
import { useRouter,useRoute } from 'vue-router';
const route=useRoute()
const router=useRouter()
onMounted(()=>{
    fan()
})

//反填的m
const data=ref({
    "id": 0,
  "name": "",
  "jiaGe": 0,
  "fjHao": "",
  "zhuangTai": null,
})

//房间号
const fjh=ref(["102","103","104","105","106","107","108","109",])
//数量
const sl=ref([])

const fan=(c:any)=>{
   axios.get("https://localhost:7206/api/FX/Fan",{params: route.query.id}).then(res=>{
    data.value=res.data
   
    
   })
}
</script>

<style scoped>

</style>